Dynomotion

Group: DynoMotion Message: 10340 From: darrengladysz Date: 10/19/2014
Subject: Homing gantry with slave axis

Hi Tom


Hope you are doing well.


I have a few questions about programming the homing sequence for a master/slave axis on my cnc router with a gantry.


First off, my x axis is driven by two servos, one on each side and one slaved to the other.


The slave axis's count is the reverse sign of the master and I have set the slave gain to -1 on account of this.  Is this the proper manner to handle this or is there a better way to do this.  (ie. possibly by setting input and output gain to -1) and if so what would I also need to change in kmotioncnc.  I do not believe I can change the sign of the gain on the drive.


I looked at your example file "homeslaved.c" in the c programs folder of the kmotion432 folder.  I notice that your distances and speeds are not the reverse sign for the 2nd axis.  How do you accomplish this?  Do you set input and output gain at -1?  If so, do I need to change anything in kmotioncnc as well?


Also, when using commands such as moveatvel(axis, distance, speed).  If my axis are reversed sign and I wish both to travel the same distance and at the same speed do I need to reverse the sign on the slave for both speed and distance?


for example, to move both I would issued the following commands:


MoveAtVel(X0_Axis, X0_Dist, speed)

MoveAtVel(X3_Axis, -X0_Dist,-speed)


Or do I simply need to reverse the sign on the X0_Dist variable and not include a sign on the speed as follows:


MoveAtVel(X0_Axis, X0_Dist, speed)

MoveAtVel(X3_Axis, -X0_Dist, speed)



Thank you


Darren

 

Group: DynoMotion Message: 10352 From: Tom Kerekes Date: 10/20/2014
Subject: Re: Homing gantry with slave axis
Hi Darren,

The simplest solution is probably to set up the individual Axis such that both the Master and Slave both move physically in the +X direction when commanded to move +X.  You would adjust the InputGain0 and OutputGain's to achieve this.

The HomeSlaved.c example assumes the above so that the motors can be commanded the same direction to move together.  Whether or not the Input/Output Gains need to be reversed depends on many things such as how the motor is wired, how the motors are oriented, etc...

From KMotionCNC's point-of-view (or Mach3's) the Slave doesn't even exist.  It is only aware of the Master Axis and commands that like any other axis.  KFLOP internally Slaves the other axis to follow.

Regarding MoveAtVel() function:  The 3rd parameter is the maximum allowed magnitude of velocity.  It should always be specified as a positive value regardless of the direction the axis is commanded to move.  So your 2nd example would be correct.

HTH
Regards
TK


From: "darrengladysz@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Sunday, October 19, 2014 10:37 PM
Subject: [DynoMotion] Homing gantry with slave axis

 
Hi Tom

Hope you are doing well.

I have a few questions about programming the homing sequence for a master/slave axis on my cnc router with a gantry.

First off, my x axis is driven by two servos, one on each side and one slaved to the other.

The slave axis's count is the reverse sign of the master and I have set the slave gain to -1 on account of this.  Is this the proper manner to handle this or is there a better way to do this.  (ie. possibly by setting input and output gain to -1) and if so what would I also need to change in kmotioncnc.  I do not believe I can change the sign of the gain on the drive.

I looked at your example file "homeslaved.c" in the c programs folder of the kmotion432 folder.  I notice that your distances and speeds are not the reverse sign for the 2nd axis.  How do you accomplish this?  Do you set input and output gain at -1?  If so, do I need to change anything in kmotioncnc as well?

Also, when using commands such as moveatvel(axis, distance, speed).  If my axis are reversed sign and I wish both to travel the same distance and at the same speed do I need to reverse the sign on the slave for both speed and distance?

for example, to move both I would issued the following commands:

MoveAtVel(X0_Axis, X0_Dist, speed)
MoveAtVel(X3_Axis, -X0_Dist,-speed)

Or do I simply need to reverse the sign on the X0_Dist variable and not include a sign on the speed as follows:

MoveAtVel(X0_Axis, X0_Dist, speed)
MoveAtVel(X3_Axis, -X0_Dist, speed)


Thank you

Darren